#!/bin/bash

if [ "$1" = "grammar" ]
then
    java -jar ../sablecc-3.2/lib/sablecc.jar minijava.grammar
elif [ "$1" = "code" ]
then
    rm minijava/*.class
    javac minijava/Compiler.java
elif [ "$1" = "compiler" ]
then
    java minijava.Compiler $2
else
    echo 'run.sh: invalid parameter';
fi
